<%@ page language="java" import="java.util.*,com.hs.hbp.model.*,com.hs.hbp.action.*,com.hs.core.utils.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String searchStr = (String)request.getAttribute("searchStr");
String field = (String)request.getAttribute("field");
String nianfen = (String)request.getAttribute("nianfen");

String language = (String)request.getAttribute("language"); 
String searchresult = (String)request.getAttribute("searchresult"); 
 
String count =  request.getAttribute("count")+"";
String startitem =  request.getAttribute("startitem")+"";

String enditem =  request.getAttribute("enditem")+"";

PageUtil pageUtil = (PageUtil)request.getAttribute("dataList");
   String pageStr = ""; 
  int perpageCount = 1;
  int currentPage = 1;
   List dataList = null;
   if(null != pageUtil){
	   dataList = pageUtil.getPageList();
	   pageStr = pageUtil.getPageStr();
	   perpageCount = pageUtil.getNumberPerPage();
	   currentPage = pageUtil.getCurrentPage();
} 

 

 

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>

<title></title>
<script src="<%=basePath %>app/javascripts/jquery-1.5.1.js"></script>
<script src="<%=basePath %>app/javascripts/layout.js"></script>
<script src="<%=basePath %>common/js/common.js"></script>
<script src="<%=basePath %>common/js/check.js"></script>
<script src="<%=basePath %>common/js/grap.js"></script> 
<script src="<%=basePath %>app/javascripts/png.js"></script>
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/My97DatePicker/WdatePicker.js"></script>

<link rel="stylesheet" type="text/css" href="<%=basePath %>app/css/layout.css">
<style>.tac{text-align:center}</style>
<script language=JavaScript type=text/JavaScript>
 function searchData()
{
  document.searchform.submit();
}

function searchDetail(rid,type)
{
  var pageURL = "<%=basePath %>searchDetail.do?rid=" + rid + "&language=" + type;
   openwindow(pageURL,'800','600',''); 
}

function clearData()
{
  document.searchform.elements["searchStr"].value="";
}
function nextpage(url,searchstr){ 
    window.parent.right.frameElement.src = "<%=basePath %>searchZhuData.do?"+url+"&searchStr="+encodeURIComponent(searchstr);

}
function fullTextSearch(){
	document.location.href="<%=basePath %>searchZhuData.do";
}
function secondSearch(){
	var searchsql = document.pageForm.searchSql.value;
	searchform.onesql.value = searchsql;
	document.searchform.submit();
}

</script>
</head>
<body>
  <div class="cont">
    <form name="searchform" action="<%=basePath %>listHbpZhu.do"  >
     <table width="80%" border="0" cellspacing="0" cellpadding="0" class="sear">
     	<tr>
     	    <td width="5%" align="right">
     	         <img src="<%=basePath %>app/images/ico_sear.gif" /> 
     	    </td>
     	    <td width="5%" align="left">
     	         年份:
     	    </td>
     		<td width="15%" align="left">
			<input type="text" class="Wdate" id="nianfen" value="<%=nianfen == null?"":nianfen%>" style="width:70%;vertical-align:middle" name="nianfen"  onFocus="WdatePicker({el:'nianfen',dateFmt:'yyyy'})"  />
			</td>
			<td width="15%">
				<select name="field" style="width:100%;vertical-align:middle"> 
	              <option value="title" <%if("title".equals(field)){ out.print(" selected");} %>>标题</option>
	              <option value="author" <%if("author".equals(field)){ out.print(" selected");} %>>作者</option>
	              <option value="chubanwu" <%if("chubanwu".equals(field)){ out.print(" selected");} %>>出版物</option>
	              <option value="thewords" <%if("thewords".equals(field)){ out.print(" selected");} %>>主题词</option>
	              <option value="abstract" <%if("abstract".equals(field)){ out.print(" selected");} %>>摘要</option> 
	             </select>    
             </td> 
             <td width="40%">        
			<input name="searchStr"  type="text" value="<%=searchStr ==null?"":searchStr%>" style="width:100%;height:18px;vertical-align:middle;" onKeyPress="if(event.keyCode==13) searchData()"/>
			</td>
			<td width="10%" align="center" > 
            <input   type="submit"  value=" 检  索 " class="butt4" onclick="searchData();"/>
            </td>
            <%if(!"".equals(pageStr) && null != searchStr){ %>
            <td width="10%"> 
            <input   type="button"  value="二次检索" class="butt4" onclick="secondSearch();"/> 
            <input   type="hidden"  value="" name="onesql"/> 
            </td>
            <%} %>  
     	</tr>
     </table>       
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
          <tr> 
            <th width="5%">序号</th>
            <th width="25%">标题</th>
            <th width="20%">副标题</th>
            <th width="20%">作者</th> 
            <th width="20%">出版物</th>
            <th width="10%">出版日期</th>
          </tr>
          <%if(dataList != null && dataList.size()>0){ 
			    for(int i =0;i<dataList.size();i++){
			       HbpZhu obj = (HbpZhu)dataList.get(i);
			       String type = obj.getImporttype();
			       if("3".equals(type))
			            type="2";
			       
 			%>
			<tr> 
			<td align="center"><%= perpageCount*(currentPage-1)+i+1 %></td>
			<td><a href="javaScript:searchDetail(<%=obj.getRid()%>,'<%if("1".equals(type)){out.print("cn");}if("2".equals(type)){out.print("en");}%>');" ><%if("1".equals(type)){out.print(obj.getTitle()==null?"":obj.getTitle());}
			                                                             else if("2".equals(type)){out.print(obj.getEntitle()==null?"":obj.getEntitle());}%></a></td>
			<td><%if("1".equals(type)){out.print(obj.getEntitle()==null?"":obj.getEntitle());}%></td>
			                                                             
			<td><%=obj.getAuthor()==null?"":obj.getAuthor()%></td>
 			<td> <%if("1".equals(type)){out.print(obj.getSourcecode()==null?"":obj.getSourcecode());}
			     else if("2".equals(type)){out.print(obj.getPeriodicalname()==null?"":obj.getPeriodicalname());}%></td>
			<td align="center"> 
			<%if("1".equals(type)){out.print(obj.getPublishyear()==null?"":obj.getPublishyear());}
			     else if("2".equals(type)){out.print(obj.getPublishyear()==null?"":obj.getPublishyear()+"-");out.print(  obj.getPublishdate()==null?"":obj.getPublishdate());}%>
			</td>
			</tr>
			<%}}else{ %>
			 <tr>
			<td colspan="6" align=center> 
			      <font color=red>没有符合条件的结果</font></td>
			      </tr>
		   <%} %>
         
        </table>
		</form>
        <div class="page"><%=pageStr %></div> 
</div>
</body>
</html>
